package com.code.web.user;

import com.alibaba.csp.sentinel.annotation.SentinelResource;
import com.code.common.web.annotations.ResponseResult;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 测试用户网关限流管理控制器
 *
 * @author tangyifei
 */
@ResponseResult
@RestController("userSentinelController")
@RequestMapping("/sentinels")
public class UserSentinelController {

    /**
     * 获取资源
     *
     * @return 资源
     */
    @ApiOperation(value = "获取资源", notes = "获取资源", httpMethod = "GET")
    @GetMapping("/resource")
    @SentinelResource(value = "sentinelsresource")
    public String getResource() {
        return "测试资源的定义";
    }

}
